CC = gcc

SRCS := $(shell find . -name '*.c')
OBJS := $(patsubst %.c, %.o, $(SRCS))

OUT_DIR := ./output
TARGET := $(OUT_DIR)/demo

C_INC += \
		./src/common/CircularBuffer \
		./src/common/fifo			\
		./src/common/list			\
		./src/common/mutex			\
		./src/common/rbuf			\
		./src/log					\
		./src/utils/cJSON			\
		./src/utils/md5


CFLAGS += -Wall -Wextra -lpthread
CFLAGS += $(addprefix -I, $(C_INC))


all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o $@ $^

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@


clean:
	rm -rf $(OBJS) $(TARGET)

.PHONY: all clean
